﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace MailChimpAmazon.SES.Results
{
	public class GetSendStatisticsResult
	{
		/// <summary>
		/// Number of emails that have bounced
		/// </summary>
		public long Bounces { get; set;}

		/// <summary>
		/// Number of unwanted emails that were rejected by recipients.
		/// </summary>
		public long Complaints { get; set; }

		/// <summary>
		/// Number of emails that have been enqueued for sending.
		/// </summary>
		public long DeliveryAttempts { get; set; }

		/// <summary>
		/// Number of emails rejected by Amazon SES.
		/// </summary>
		public long Rejects { get; set; }

		/// <summary>
		/// Time of this data point.
		/// </summary>
		// public DateTime Timestamp { get; set; }
		// Todo: Work around the format exception we get for this
		// System.FormatException : DateTime content '2011-03-01T12:42:00Z' does not start with '\/Date(' and end with ')\/' as required for JSON.

		public override string ToString()
		{
			return String.Format("Bounces: {0}, Complaints: {1}, DeliveryAttempts: {2}, Rejects: {3}",
									Bounces,
									Complaints,
									DeliveryAttempts,
									Rejects);
		}
	}
}
